import { FormSchema } from '@/components/Table';
import { BasicColumn } from '@/components/Table/src/types/table';

export const detailSchemas: FormSchema[] = [
  {
    field: 'memberName',
    component: 'Input',
    label: '客户名称',
    colProps: {
      span: 23,
    },
    componentProps: {
      disabled: false,
    },
    required: true,
  },
  {
    field: 'date',
    component: 'DatePicker',
    label: '购买时间',
    colProps: {
      span: 12,
    },
    required: true,
    componentProps: {
      disabled: false,
    },
  },
  {
    field: 'money',
    component: 'Input',
    label: '金额',
    colProps: {
      span: 12,
    },
    componentProps: {
      disabled: false,
    },
    required: true,
  },
  {
    field: 'device',
    component: 'Select',
    label: '类别',
    colProps: {
      span: 12,
    },
  },
  {
    field: 'deviceModel',
    component: 'Select',
    label: '购买型号',
    colProps: {
      span: 12,
    },
    required: true,
  },
  {
    field: 'phone',
    component: 'Input',
    label: '手机',
    colProps: {
      span: 12,
    },
    componentProps: {
      disabled: false,
    },
  },
  {
    field: 'wechat',
    component: 'Input',
    label: '微信',
    componentProps: {
      disabled: false,
    },
    colProps: {
      span: 12,
    },
  },
  {
    field: 'mail',
    component: 'Input',
    label: '邮箱',
    colProps: {
      span: 12,
    },
    componentProps: {
      disabled: false,
    },
  },
  {
    field: 'qq',
    component: 'Input',
    label: '腾讯qq',
    colProps: {
      span: 12,
    },
    componentProps: {
      disabled: false,
    },
  },
  {
    field: 'address',
    component: 'Input',
    label: '地址',
    colProps: {
      span: 24,
    },
    required: true,
    componentProps: {
      disabled: false,
    },
  },
  {
    field: 'returnOfGoods',
    component: 'RadioGroup',
    label: '是否退货',
    colProps: {
      span: 12,
    },
    required: true,
    componentProps: {
      disabled: true,
      options: [
        { label: '是', value: 0 },
        { label: '否', value: 1 },
      ],
    },
  },
  {
    field: 'afterSalesEngineer',
    component: 'Input',
    label: '售后工程师',
    colProps: {
      span: 12,
    },
    required: true,
    componentProps: {
      disabled: false,
    },
  },
  {
    field: 'source',
    component: 'Select',
    label: '线索来源',
    colProps: {
      span: 12,
    },
    required: true,
    componentProps: {
      disabled: false,
      options: [], // 接口获取
    },
  },
  {
    field: 'serviceType',
    component: 'Select',
    label: '服务类型',
    colProps: {
      span: 12,
    },
    required: true,
    componentProps: {
      options: [
        { label: '上门服务', value: '上门服务', key: '上门服务' },
        { label: '视频服务', value: '视频服务', key: '视频服务' },
      ],
      disabled: false,
    },
  },
  {
    field: 'returnReason',
    component: 'Select',
    label: '退货原因',
    colProps: {
      span: 12,
    },
  },
  {
    field: 'returnReasonData',
    component: 'Input',
    label: '',
    colProps: {
      span: 12,
    },
    componentProps: {
      disabled: false,
    },
  },
  {
    field: 'customerType',
    component: 'Select',
    label: '会员类型',
    colProps: {
      span: 24,
    },
    required: true,
    componentProps: {
      disabled: false,
      options: [
        { label: '新客户', value: '新客户', key: '新客户' },
        { label: '老客户', value: '老客户', key: '老客户' },
      ],
    },
  },
];

export function reminderDetail1(): FormSchema[] {
  return [
    {
      field: 'orderId',
      component: 'Input',
      label: '订单编号',
      colProps: {
        span: 24,
      },
      componentProps: {
        disabled: false,
      },
      required: true,
    },
    {
      field: 'channel',
      component: 'Input',
      label: '渠道',
      colProps: {
        span: 12,
      },
      componentProps: {
        disabled: false,
      },
      required: true,
    },
    {
      field: 'money',
      component: 'Input',
      label: '金额',
      colProps: {
        span: 12,
      },
      componentProps: {
        disabled: false,
      },
      required: true,
    },
    {
      field: 'firstFollowUpDate',
      component: 'DatePicker',
      label: '第一次服务日期',
      labelWidth: 160,
      helpMessage: ['提醒更换滤芯'],
      colProps: {
        span: 12,
      },
      required: true,
    },
    {
      field: 'firstFollowUp',
      component: 'Input',
      label: '第一次服务记录',
      labelWidth: 160,
      colProps: {
        span: 12,
      },
    },
    {
      field: 'secondFollowUpDate',
      component: 'DatePicker',
      label: '第二次服务日期',
      labelWidth: 160,
      helpMessage: ['日常跟进'],
      colProps: {
        span: 12,
      },
      required: true,
    },
    {
      field: 'secondFollowUp',
      component: 'Input',
      label: '第二次服务记录',
      labelWidth: 160,
      colProps: {
        span: 12,
      },
    },
    {
      field: 'thirdFollowUpDate',
      component: 'DatePicker',
      label: '第三次服务日期',
      labelWidth: 160,
      helpMessage: ['保养服务'],
      colProps: {
        span: 12,
      },
      required: true,
    },
    {
      field: 'thirdFollowUp',
      component: 'Input',
      label: '第三次服务记录',
      labelWidth: 160,
      colProps: {
        span: 12,
      },
    },
  ];
}

export const getBasicColumns: BasicColumn[] = [
  {
    title: '服务时间',
    dataIndex: 'reminderDate',
  },
  {
    title: '状态',
    dataIndex: 'remiderType',
  },
  {
    title: '提醒内容',
    dataIndex: 'remider',
  },
  {
    title: '设备名称',
    dataIndex: 'device',
  },
  {
    title: '设备型号',
    dataIndex: 'deviceModel',
  },
  {
    title: '订单ID',
    dataIndex: 'orderId',
  },
  {
    title: '购买渠道',
    dataIndex: 'channel',
  },
  {
    title: '配件金额',
    dataIndex: 'money',
  },
  {
    title: '沟通记录',
    dataIndex: 'communicationRecords',
  },
  {
    title: '操作人',
    dataIndex: 'operator',
  },
];
